package com.zhengke.pojo;

import java.util.List;

public class Result {

	private int code;
	
	private String msg;
	
	private int count;
	
	private List<?> data;
	
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public List<?> getData() {
		return data;
	}

	public void setData(List<?> data) {
		this.data = data;
	}

	public Result() {
		this.code = 0;
		this.msg = "success";
	}
	
	public Result(List<?> data) {
		this.data = data;
	}
	/**
	 * 返回一个空的Result对象
	 * 当没有返回数据时
	 * @return
	 */
	public static Result getResult() {
		return new Result();
	}
	
	/**
	 * 需要返回数据时使用
	 * @param data
	 * @return
	 */
	public static Result getResult(List<?> data) {
		return new Result(data);
	}
}
